package com.ocom.mqsimple.controller;

import com.ocom.common.constant.MqSimpleApiUrl;
import com.ocom.common.resp.Result;
import com.ocom.common.utils.ResultUtil;
import com.ocom.common.vo.webapi.ImportCardVo;
import com.ocom.mqsimple.business.card.ProvideCardProductService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: TODO
 * @Author: 朱晖
 * @Date: 2022/8/16
 **/
@Slf4j
@RestController
public class ImportCardController {

	@Autowired
	ProvideCardProductService provideCardProductService;

	@PostMapping(MqSimpleApiUrl.URL_importCard)
	public Result importCard(@RequestBody ImportCardVo importCardVo){
		log.info("异步发卡操作,【{}】",importCardVo);
		provideCardProductService.handle(importCardVo);
		return ResultUtil.success();
	}
}
